package com.wyix.config;

import com.wyix.device.Light;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 智能家庭配置属性
 * 对应文档中的@ConfigurationProperties知识点
 *
 * @author wangdx
 * @since 2025/8/19
 */
@ConfigurationProperties(prefix = "smart.home")
public class SmartHomeConfig {
    private final Light light = new Light();
    private final Thermostat thermostat = new Thermostat();
    private boolean securityEnabled = false;
    private String environment;

    public static class Light {
        private String color = "white";
        private int brightness = 80;
        private boolean enabled = true;

        // Getters and Setters
        public String getColor() {
            return color;
        }

        public void setColor(String color) {
            this.color = color;
        }

        public int getBrightness() {
            return brightness;
        }

        public void setBrightness(int brightness) {
            this.brightness = brightness;
        }

        public boolean isEnabled() {
            return enabled;
        }

        public void setEnabled(boolean enabled) {
            this.enabled = enabled;
        }
    }

    public static class Thermostat {
        private double defaultTemp = 24.0;
        private boolean autoAdjust = true;

        // Getters and Setters
        public double getDefaultTemp() {
            return defaultTemp;
        }

        public void setDefaultTemp(double defaultTemp) {
            this.defaultTemp = defaultTemp;
        }

        public boolean isAutoAdjust() {
            return autoAdjust;
        }

        public void setAutoAdjust(boolean autoAdjust) {
            this.autoAdjust = autoAdjust;
        }
    }

    // Getters
    public Light getLight() {
        return light;
    }

    public Thermostat getThermostat() {
        return thermostat;
    }

    public boolean isSecurityEnabled() {
        return securityEnabled;
    }

    public void setSecurityEnabled(boolean securityEnabled) {
        this.securityEnabled = securityEnabled;
    }

    public String getEnvironment() {
        return environment;
    }

    public void setEnvironment(String environment) {
        this.environment = environment;
    }

}
